Expand oxlint config for better eslint parity#2972
Expand oxlint config for better eslint parity#2972bradenmacdonald merged 7 commits intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @bradenmacdonald! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
| url, | ||
| }) => ( | ||
| <CardItem | ||
| key={courseKey} |
There was a problem hiding this comment.
This was resulting in a React console warning, and eslint was not picking it up but oxlint now catches it.
installHook.js:1 Warning: Each child in a list should have a unique "key" prop.
Check the render method of `CardList`. See https://reactjs.org/link/warning-keys for more information.
| {blockTypes.map((blockTypeObj) => ( | ||
| <BlockCardButton | ||
| {...blockTypeObj} | ||
| key={blockTypeObj.blockType} |
There was a problem hiding this comment.
This was resulting in a React console warning, and eslint was not picking it up but oxlint now catches it.
installHook.js:1 Warning: Each child in a list should have a unique "key" prop.
Check the render method of `AddNewContent`. See https://reactjs.org/link/warning-keys for more information.
at BlockCardButton (webpack-internal:///./src/generic/sidebar/BlockCardButton.tsx:26:3)
at AddNewContent (webpack-internal:///./src/course-unit/unit-sidebar/AddSidebar.tsx:90:88)
| /> | ||
| ) : ( | ||
| <CourseUpdate | ||
| key={courseUpdate.id} |
There was a problem hiding this comment.
This was resulting in a React console warning, and eslint was not picking it up but oxlint now catches it.
Warning: Each child in a list should have a unique "key" prop.
Check the render method of `CourseUpdates`. See https://reactjs.org/link/warning-keys for more information.
at CourseUpdate (webpack-internal:///./src/course-updates/course-update/CourseUpdate.jsx:32:3)
at CourseUpdates (webpack-internal:///./src/course-updates/CourseUpdates.tsx:69:87)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2972 +/- ##
==========================================
+ Coverage 95.59% 95.61% +0.02%
==========================================
Files 1379 1378 -1
Lines 32278 32289 +11
Branches 7387 7406 +19
==========================================
+ Hits 30856 30873 +17
+ Misses 1371 1352 -19
- Partials 51 64 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@ChrisChV Would you be able to review this? |
|
@bradenmacdonald Yes, sorry, I didn't see the notification. |
ChrisChV
left a comment
There was a problem hiding this comment.
Looks good! Thanks! 👍
- I tested this: I made a general test of the platform
- I read through the code and considered the security, stability and performance implications of the changes.
- Includes documentation
Description
Relates to: #2559
We have deliberately not been running
eslintfor a while now. I wanted to see if any issues have gotten into the code that eslint would have caught, but oxlint is not catching.There were some issues: a react hook violation, some unused imports, and some formatting issues.
It turns out that I just needed to tweak the oxlint configuration and it was now able to catch those issues too, as well as more issues. We didn't have the react plugin enabled, so I enabled it now, and it caught a lot of missing
keyerrors.Remaining issues
There are a few remaining issues that eslint is flagging that oxlint does not pick up:
The reason is that oxlint considers these to be formatting issues, not lint issues, and they would be detected/fixed by oxfmt. Using oxfmt is worth a separate PR/discussion.
Private ref MNG-4763